import request from '@/utils/request'

/**
 * 获取房产列表
 */
export function getPropertiesApi(params) {
  return request({
    url: '/properties',
    method: 'get',
    params
  })
}
/**
 * 获取房产数量
 */
export function getPropertiesCounApi(params) {
  return request({
    url: '/properties/count',
    method: 'get',
    params
  })
}
/**
 * 根据id获取房产
 */
export function getPropertyApi(id) {
  return request({
    url: `/properties/${id}`,
    method: 'get'
  })
}

/**
 * 删除
 */
export function delPropertiesApi(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}
/**
 * 编辑
 */
export function editPropertiesApi(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * 新增
 */
export function addPropertiesApi(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}
